package com.todo.event.activity.infrastructure.mapper;


import com.todo.event.activity.infrastructure.entity.condition.EventActivityCondition;
import com.todo.event.activity.infrastructure.entity.po.EventActivityPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/1/6 19:33
 * @description
 */
@Mapper
public interface EventActivityMapper {

    int insertEventActivity(EventActivityPO eventActivityPO);

    int updateEventActivity(EventActivityPO eventActivityPO);

    EventActivityPO queryEventActivityById(@Param("id") Long id);

    int removeEventActivityById(@Param("id") Long id);

    int updateEventActivityStatus(@Param("id") Long id, @Param("oldStatus") Integer oldStatus, @Param("newStatus") Integer newStatus);

    Long queryCountByCondition(EventActivityCondition eventActivityCondition);

    List<EventActivityPO> queryEventActivityListByCondition(EventActivityCondition eventActivityCondition);

    /**
     * 默认不过期的数据
     *
     * @param decisionId
     * @return
     */
    List<EventActivityPO> queryEventActivityListByDecisionId(@Param("decisionId") Long decisionId, @Param("expireTime") Date expireTime);

    EventActivityPO queryEventActivityByName(@Param("name") String name);
}
